package com.xj.demo.jvmutil;

import java.util.ArrayList;
import java.util.List;

/**
 * vm args: -Xmx60m -Xms60m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=H:\test.hprof
 */
public class GCTest {
    public static void main(String[] args) {
        List<byte[]> list = new ArrayList<>();
        while (true){
            list.add(new byte[1024*1024]);
            try {
                Thread.sleep(50);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
